//
// Created by 123 on 2025/1/13.
//
#include "iostream"
#include "numeric"
#include "vector"
#include "algorithm"

class MyPrint{
public:
    void operator()(int val){
        std::cout << val << " ";
    }
};

void test(){
    std::vector<int> v;
    for (int i = 0; i < 10; ++i) {
        v.push_back(i);
    }
    int total =  std::accumulate(v.begin(), v.end(),5);
    std::cout << "total=" << total << std::endl;
}

void test2(){
    std::vector<int> v;
    v.resize(10);
    std::fill(v.begin(), v.end(),1000);
    std::for_each(v.begin(), v.end(),MyPrint());
}

int main162(){
    test();
    test2();
    return 0;
}
